import os

from testconfig import config

from framework.basetest import BaseTest


class AndrAppHeadspinReoTest(BaseTest):

    def setUp(self):
        super().setUp(config=config)

    def tearDown(self):
        super().tearDown()

    def test_clear_headspin_repo(self):
        ret = self.hs_api.clear_upload_app_by_identifier(self.appPackage)
        self.assertTrue(ret)

    def test_upload_apk_to_headspin_repo(self):
        file_full_path = os.path.join(os.path.sep, os.getenv('app_store_path'), self.androidBuildCommit)
        response = self.hs_api.upload_app(file_full_path, self.androidBuildCommit)
        self.assertEqual(200, response.status_code)
